home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / rlib20.zip / RL_FILES.PRG < prev    next >
Text File  |  1989-02-18  |  906b  |  34 lines

  1. * Function: FILES
  2. * Author..: Richard Low
  3. * Syntax..: FILES( <expC> [, <expC> [, <expC> ... )
  4. * Returns.: True if all the files listed as parameters exist.
  5. * Assumes.: Filenames are character strings or character variables.
  6. *           Will allow up to 9 filenames to check at once.
  7.  
  8. FUNCTION FILES
  9. PARAMETERS p_1, p_2, p_3, p_4, p_5, p_6, p_7, p_8, p_9
  10. PRIVATE f_pcount, f_x, f_parname
  11.  
  12. *-- see how many parameters were passed
  13. f_pcount = PCOUNT()
  14.  
  15. *-- check each one
  16. FOR f_x = 1 TO f_pcount
  17.    *-- build a memvar of the parameter name
  18.    f_parname = 'p_' + LTRIM(STR(f_x,3,0))
  19.  
  20.    *-- make sure it's character type, if not, bomb out
  21.    IF .NOT. TYPE(f_parname) = 'C'
  22.       RETURN (.F.)
  23.    ENDIF
  24.  
  25.    *-- if any one of them does not exist, we return .F.
  26.    IF .NOT. FILE(&f_parname)
  27.       RETURN (.F.)
  28.    ENDIF
  29.  
  30. NEXT f_x
  31.  
  32. *-- otherwise all files must be there
  33. RETURN (.T.)
  34.